/*
 Peyote 3D 
 Render Defines
 
 Copyright (c) 2010 Douglas J Lockamy
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */

#ifndef RENDER_H
#define RENDER_H

#include <graphics/geometry.h>

class Camera;

class BRender
{
public:
	virtual void init(void) = 0;

	//Texture management
	virtual int loadTexture(char *image, int width, int height) = 0;
	virtual int loadTextureFromFile(const char* path, int width, int height) = 0;
	virtual int releaseTexture(int texID) = 0;	

	//Render Managment
	virtual int BeginFrame(void) = 0;
	virtual int EndFrame(void) = 0;
	virtual void Lock(void) = 0;
	virtual void UnLock(void) = 0;
	
	virtual void ScreenShot(char* buffer, int left,int top, int right, int bottom) = 0;
	
	virtual void SetViewPort(Camera *camera) = 0;
	
	virtual void PushTriangles(face &thisFace) = 0;
	
	//Text Drawing functions
	virtual int putString(const char* string, point_i location  ) = 0;
	
	// 2D Drawing functions
	virtual int drawLine(point_i start, point_i end) = 0;
	virtual int drawCircle(point_i center, int radius) = 0;
	virtual int drawRect(rect_i rect) = 0;
	virtual int drawPoly(void) = 0;
	
	virtual int fillCircle(point_i center, int radius, int color) = 0;
	virtual int fillRect(rect_i rect, int color) = 0;
	virtual int fillPolly(void) = 0;
private:
	int lock;
	
};

#endif //RENDER_H
